home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-05 | 1.4 KB | 65 lines | [TEXT/CWIE] |
- // ===========================================================================
- // UDrawingState.More.cp ©1994 Mike Shields. All rights reserved.
- // ===========================================================================
- //
- // Classes for saving/restoring the drawing state
- //
- // For each class, the Constructor saves the current state and the
- // Destructor restores it, so you can use stack-based objects to
- // automatically save and restore the state.
- //
- // There are separate Save and Restore functions in case you want to
- // explicitly change the state (at other than construct and destruct time).
- //
- // Finally, each class has a Normalize function which sets the state of
- // the current GrafPort to default values (same as those set by OpenPort).
-
- #ifdef PowerPlant_PCH
- #include PowerPlant_PCH
- #endif
-
- #include "UDrawingState.More.h"
-
- // ===========================================================================
- // StPenState
- // ===========================================================================
- //
- // Pen State Info:
- // Pen Location
- // Pen Size
- // Pen Mode
- // Pen Pattern
-
- StPenState::StPenState()
- {
- ::GetPenState(&mPenState);
- }
-
-
- StPenState::~StPenState()
- {
- ::SetPenState(&mPenState);
- }
-
-
- void
- StPenState::Save()
- {
- ::GetPenState(&mPenState);
- }
-
-
- void
- StPenState::Restore()
- {
- ::SetPenState(&mPenState);
- }
-
-
- void
- StPenState::Normalize()
- {
- ::PenNormal();
- }
-
-